package com.dmxh.controller;

import com.dmxh.pojo.TbUser;
import com.dmxh.result.Result;
import com.dmxh.vo.UserVo;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mq")
public class MqController {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @PostMapping("/productMessage")
    public void productMessage(@RequestBody UserVo userVo) {
        rocketMQTemplate.convertAndSend("dongdongshop-g",userVo);
    }
}
